// Custom theme scripts for GJW Titmuss obile template
// Author:  J.Dennis
// Date:    01/11/13

////////////////////////////////////////////////////////////////////////////////////////////////////////

// fucntions and scripts that need to initialise on document load and on ajax complete
function loaded() {

	$("#left-panel, #right-panel").panel({
	  beforeopen: function() {
		  $(".ui-page-active").css({
				"overflow-y":"hidden",
				"position":"fixed"
			});
		}
	});
	$("#left-panel, #right-panel").panel({
	  beforeclose: function() {
		  $(".ui-page-active").css({
			"overflow-y":"visible",
			"position":"absolute"
			});
		}
	});

}

// functions and scripts that need to initialise on document load
$(document).ready(function () {
	

    ////////////////////////////////////////////////////////////////////////////////////////////////////////
	
	$("#banner").owlCarousel({
		slideSpeed : 300,
		paginationSpeed : 400,
		singleItem : true,
		pagination : false
	});
	$("#product_carousel").owlCarousel({
		navigation : false,
		slideSpeed : 300,
		paginationSpeed : 400,
		singleItem : true,
		pagination : false
	});

    ////////////////////////////////////////////////////////////////////////////////////////////////////////

    // General initialization/calls/settings

    loaded();   // fucntions and scripts that need to initialise on document load and on ajax complete
});

// fucntions and scripts that need to initialise on ajax complete
$(document).ajaxComplete(function () {
    loaded();
});